package cn.sunxyz.create.simplefactory;

/**
 * Created by yangrd on 2017/5/12.
 */
public class Factory {

    public static Product createProdut(String arg) {
        if (arg.equalsIgnoreCase("A")) {
            return new ProductA();
        } else if (arg.equalsIgnoreCase("B")) {
            return new ProductB();
        } else {
            return () -> System.out.println("defalut#methodDiff()");
        }
    }
}
